package models

type Tags struct {
	TagID   int64  `gorm:"type:bigint(20);primaryKey;comment:'标签ID'" json:"tag_id"`
	TagName string `gorm:"type:varchar(100);not null;column:tag_name;index:idx_tag_name;comment:'标签名称'" json:"tag_name" binding:"required"`

	Articles []Article `gorm:"many2many:article_tag;foreignKey:TagID;joinForeignKey:TagID;References:ArticleID;joinReferences:ArticleID" json:"articles"`
}

func (t *Tags) TableName() string {
	return "tags"
}
